(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('waf.homeController', homeController);
	homeController.$inject = [ '$scope', '$q', 'Constants', 'layoutConfig', 'authService', 'validatorConfig' ];
	function homeController($scope, $q, Constants, layoutConfig, authService, validatorConfig) {
		var ctrl = this;
		ctrl.homeConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;
		$scope.app.settings.login = false;
		$scope.app.settings.spaPage = false;
		
		ctrl.setupItems = [ {
			"callback" : "addPanelCallback",
			"itemCode" : 'addPanel',
			'label' : 'Add Panel'
		}, {
			"callback" : "customizeCallback",
			"itemCode" : 'customize',
			'label' : 'Customize'
		} ];
		
		ctrl.toggleDashboardSetupDropdown = function($event, item) {
			var callback = item.callback;
			if (callback) {
				if (callback && angular.isString(callback)) {
					callback = ctrl[callback];
				}
				callback(item, $event);
			}
		};
		
		ctrl.addPanelCallback = function(item, $event) {
			console.log('addPanelCallback');
		}
		
		ctrl.customizeCallback = function(item, $event) {
			console.log('customizeCallback');
		}
	}
})(angular);
